#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
    char name[15] = { 0 }, num[5] = { 0 };
    int n = 0;
    scanf("%d", &n);
    int i = 0, j = 0;
    int score = 0;
    double s = 0, ave = 0;
    for (i = 0; i < n; i++)
    {
        scanf("%s %s %lf", num, name, &score);
    }
    for (i = 0; i < n; i++)
    {
        s += score;
        ave = s / n;
        if (score < ave)
        {
            printf("%s %s", name, num);
        }
    }
    return 0;
}